package com.tcoiss.kettle.api.factory;

import com.alibaba.fastjson.JSONObject;
import com.tcoiss.kettle.api.RemoteKettleTransService;
import com.tcoiss.kettle.api.request.TransReq;
import com.tcoiss.kettle.api.response.TransRes;
import com.tcoiss.kettle.common.povo.PageOut;
import com.tcoiss.kettle.common.povo.QueryHelper;
import com.tcoiss.kettle.common.povo.Result;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Component
public class RemoteKettleTransFallbackFactory implements FallbackFactory<RemoteKettleTransService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteKettleTransFallbackFactory.class);

    @Override
    public RemoteKettleTransService create(Throwable throwable)
    {
        log.error("kettle转换服务调用失败:{}", throwable.getMessage());
        return new RemoteKettleTransService()
        {

            @Override
            public Result<PageOut<TransRes>> findTransListByPage(QueryHelper<TransReq> req) {
                return null;
            }

            @Override
            public Result startAllTrans() {
                return null;
            }

            @Override
            public Result startTrans(Integer id) {
                return null;
            }

            @Override
            public Result stopAllTrans() {
                return null;
            }

            @Override
            public Result stopTrans(Integer id) {
                return null;
            }


        };
    }
}
